﻿namespace DesignModeConsole.创建型.工厂方法模式;

/// <summary>
/// 读取文件的接口
/// </summary>
public interface IReadFile
{
    /// <summary>
    /// 读取文件
    /// </summary>
    /// <returns></returns>
    string Read();
}

public class ReadJsonFile : IReadFile
{
    public string Read()
    {
        return "读取json格式文件";
    }
}

public class ReadXmlFile : IReadFile
{
    public string Read()
    {
        return "读取xml格式文件";
    }
}

public class ReadTxtFile : IReadFile
{
    public string Read()
    {
        return "读取txt格式文件";
    }
}